/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.DeliverySendPlace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

import java.util.List;

public interface DeliverySendPlaceMapper {
    /* @mbggenerated */
    @Delete({
        "delete from delivery_send_place",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /* @mbggenerated */
    @Insert({
        "insert into delivery_send_place (send_province_code, send_province_name, ",
        "send_city_code, send_city_name, ",
        "send_district_code, send_district_name, ",
        "create_time, create_user, ",
        "upd_time, upd_user)",
        "values (#{sendProvinceCode,jdbcType=VARCHAR}, #{sendProvinceName,jdbcType=VARCHAR}, ",
        "#{sendCityCode,jdbcType=VARCHAR}, #{sendCityName,jdbcType=VARCHAR}, ",
        "#{sendDistrictCode,jdbcType=VARCHAR}, #{sendDistrictName,jdbcType=VARCHAR}, ",
        "#{createTime,jdbcType=TIMESTAMP}, #{createUser,jdbcType=INTEGER}, ",
        "#{updTime,jdbcType=TIMESTAMP}, #{updUser,jdbcType=INTEGER})"
    })
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insert(DeliverySendPlace record);

    /* @mbggenerated */
    @InsertProvider(type=DeliverySendPlaceSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="id")
    int insertSelective(DeliverySendPlace record);

    /* @mbggenerated */
    @Select({
        "select",
        "id, send_province_code, send_province_name, send_city_code, send_city_name, ",
        "send_district_code, send_district_name, create_time, create_user, upd_time, ",
        "upd_user",
        "from delivery_send_place"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="send_province_code", property="sendProvinceCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_province_name", property="sendProvinceName", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_city_code", property="sendCityCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_city_name", property="sendCityName", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_district_code", property="sendDistrictCode", jdbcType=JdbcType.VARCHAR),
        @Result(column="send_district_name", property="sendDistrictName", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="create_user", property="createUser", jdbcType=JdbcType.INTEGER),
        @Result(column="upd_time", property="updTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="upd_user", property="updUser", jdbcType=JdbcType.INTEGER)
    })
    List<DeliverySendPlace> selectAll();

    /* @mbggenerated */
    @UpdateProvider(type=DeliverySendPlaceSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DeliverySendPlace record);

    /* @mbggenerated */
    @Update({
        "update delivery_send_place",
        "set send_province_code = #{sendProvinceCode,jdbcType=VARCHAR},",
          "send_province_name = #{sendProvinceName,jdbcType=VARCHAR},",
          "send_city_code = #{sendCityCode,jdbcType=VARCHAR},",
          "send_city_name = #{sendCityName,jdbcType=VARCHAR},",
          "send_district_code = #{sendDistrictCode,jdbcType=VARCHAR},",
          "send_district_name = #{sendDistrictName,jdbcType=VARCHAR},",
          "create_time = #{createTime,jdbcType=TIMESTAMP},",
          "create_user = #{createUser,jdbcType=INTEGER},",
          "upd_time = #{updTime,jdbcType=TIMESTAMP},",
          "upd_user = #{updUser,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(DeliverySendPlace record);
}